﻿using BuildDatabase.Repository;
using Ducu.BLL.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BuildDatabase.Factory
{
    internal static class MessageFactory
    {
        internal static void Create()
        {
            yeziToAbu("作业，你的作业呢？", true);
            yeziToAbu("晚上出来喝酒？", false);
        }

        private static void yeziToAbu(string content, bool hasRead)
        {
            Chat chat = new Chat
            {
                From = UserRepository.Yezi,
                To = UserRepository.Abu,
                Content = content,
            };
            Message message = chat.GetMessage();
            
            NHProvider.session.Save(chat);
            NHProvider.session.Save(message);
        }
    }
}
